home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / demo / rotplnnr.lha / RoutePlanner.h < prev    next >
C/C++ Source or Header  |  1994-08-20  |  5KB  |  171 lines

  1. // RoutePlanner.h
  2.  
  3. #include <exec/types.h>
  4. #include <exec/lists.h>
  5.  
  6. // Defines for SpeedCode
  7. #define USE_SPEED        (0)
  8. #define USE_TIME        (1)
  9.  
  10. #define INTERSTATE_RURAL    (2)
  11. #define INTERSTATE_SUBURBAN    (3)
  12. #define INTERSTATE_URBAN    (4)
  13. #define HIWAY_4LANE        (5)
  14. #define HIWAY_2LANE        (6)
  15. #define HIWAY_2LANE_SLOW    (7)
  16. #define HIWAY_SUBURBAN        (8)
  17. #define HIWAY_URBAN        (9)
  18.  
  19. // Northern (55 state) US defines
  20. #define INTERSTATE_NE_RURAL    (10)
  21. #define INTERSTATE_NE_URBAN    (11)
  22.  
  23. // Canada defines
  24. #define HIWAY_CANADA_AUTOROUTE    (12)
  25. #define HIWAY_CANADA_PRIMARY    (13)
  26.  
  27. // UK defines
  28. #define UK_MOTORWAY_RURAL    (14)
  29. #define UK_MOTORWAY_SUBURBAN    (15)
  30. #define UK_MOTORWAY_URBAN    (15)
  31. #define UK_PRIMARY_4LANE    (17)
  32. #define UK_PRIMARY_2LANE    (18)
  33. #define UK_OTHER_2LANE        (19)
  34.  
  35. // Defines for Units
  36. #define UNITS_METRIC        (0)
  37. #define UNITS_ENGLISH        (1)
  38.  
  39. // Defines for Directions
  40. #define DIRECTION_IGNORE    (0) // No direction defined
  41. #define DIRECTION_NORTH        (1)
  42. #define DIRECTION_NORTHEAST    (2)
  43. #define DIRECTION_EAST        (3)
  44. #define DIRECTION_SOUTHEAST    (4)
  45. #define DIRECTION_SOUTH        (5)
  46. #define DIRECTION_SOUTHWEST    (6)
  47. #define DIRECTION_WEST        (7)
  48. #define DIRECTION_NORTHWEST    (8)
  49.  
  50. // Data structures
  51.  
  52. struct OldCoords {
  53.   double longitude;
  54.   double latitude;
  55.   };
  56.  
  57. struct NewCoords {
  58.   float longitude;
  59.   float latitude;
  60.   };
  61.  
  62. #define CityData  NewCityData
  63. #define RouteData NewRouteData
  64.  
  65. struct OldCityData {
  66.                 ULONG CityID;       // city identifier
  67.                 char CityName[40];  // city name
  68.                 char StateName[24]; // state/province only
  69.                 struct RouteData *RoadList;       /* roads to/from city */
  70.                 struct CityData *WorkList;        /* temp job queue */
  71.                 struct CityData *NextCity[2];     /* result links */
  72.                 unsigned short MinDist[2];        /* closest so far */
  73.                 unsigned char Colum;        // goes with RoadList 
  74.                 unsigned char cd_Dummy;     // Dummy to l-w align stuff
  75.                 BOOL Intersection;          // If TRUE, ignored
  76.                 BOOL Displayed;             // List this city?
  77.                 BOOL CoordsExist;
  78.                 struct OldCoords CityPos;
  79.                 };
  80.  
  81. struct OldRouteData {
  82.                  ULONG RouteID;
  83.                  struct CityData *CityNum[2]; /* cities each end */
  84.                  struct RouteData *RLink[2];  /* link for each city */
  85.                  ULONG CityID[2];             // Stored in the file
  86.                  UWORD Directions[2];         /* Direction from city[n] */
  87.                  UWORD Distance;
  88.                  UWORD Speed;                 // Speed or time
  89.                  UWORD SpeedCode;
  90.                  UWORD Units;
  91.                  char Hiway[32];              /* name of Highway */
  92.                  unsigned char Colm[2];       /* goes with RLink */
  93.                  char Exits[2][6];
  94.                  };
  95.  
  96. struct NewCityData {
  97.                 struct CityData *WorkList;    /* temp job queue */
  98.                 struct CityData *NextCity[2]; /* result links */
  99.                 struct RouteData *RoadList;   /* roads to/from city */
  100.                 unsigned short MinDist[2];    /* closest so far */
  101.                 UWORD CityID;                 // city identifier
  102.                 char CityName[32];            // city name
  103.                 char StateName[22];           // state/province only
  104.                 unsigned char Colum;          // goes with RoadList 
  105.                 unsigned char cd_Dummy;       // used by RouteEdit
  106.                 unsigned char cd_Dummy2;      //
  107.                 char Intersection;            // If TRUE, ignored
  108.                 char Displayed;               // List this city?
  109.                 char CoordsExist;
  110.                 struct NewCoords CityPos;
  111.                 };
  112.  
  113. struct NewRouteData {
  114.                  struct CityData *CityNum[2];  /* cities each end */
  115.                  struct RouteData *RLink[2];   /* link for each city */
  116.                  unsigned char Colm[2];        /* goes with RLink */
  117.                  UWORD RouteID;
  118.                  UWORD CityID[2];              // Stored in the file
  119.                  UBYTE Directions[2];          /* Direction from city[n] */
  120.                  UWORD Distance;
  121.                  UWORD Speed;                  // Speed or time
  122.                  UBYTE SpeedCode;
  123.                  UBYTE Units;
  124.                  char Hiway[32];               /* name of Highway */
  125.                  char Exits[2][6];
  126.                  };
  127.  
  128. struct CityNode {
  129.   struct Node cn_Node;
  130.   struct CityData cn_City;
  131.   };
  132.  
  133. struct RouteNode {
  134.   struct Node rn_Node;
  135.   struct RouteData rn_Route;
  136.   };
  137.  
  138. struct CityName {
  139.   ULONG cn_CityID;
  140.   char cn_Name[64];
  141.   };
  142.  
  143. struct RouteName {
  144.   ULONG rn_RouteID;
  145.   char rn_Name[120];
  146.   };
  147.  
  148. struct TripEntry {
  149.   UWORD te_Distance;
  150.   UWORD te_Time;
  151.   char *te_Route;
  152.   char *te_Begin;
  153.   char *te_End;
  154.   };
  155.  
  156. #define CT_NOPOINT  0
  157. #define CT_WAYPOINT 1
  158. #define CT_ENDPOINT 2
  159.  
  160. struct CityTrail {
  161.   struct CityData *ct_City;
  162.   UWORD ct_Waypoint;
  163.   };
  164.  
  165. struct DataBaseInfo {
  166.   char dbi_Author[60];
  167.   char dbi_EMail[60];
  168.   ULONG dbi_AuthorCode;
  169.   ULONG dbi_Security;   // DFT of dbi_AuthorCode, cdcount, and rdcount
  170.   };
  171.